package com.meta.nd.filter.bo;

import com.meta.nd.filter.vo.FilterFd;
import com.meta.nd.filter.vo.ResultFd;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;

@Data
public class FilterParamDef {
    String filterDefCode;
    String targetNdCode;
    String returnNdCode;
    String resultNdCode;
    List<FilterFd> filterFds = new ArrayList<>();
    List<ResultFd> resultFds = new ArrayList<>();
    int startNo;
    int count;
    public void addFilterFd( FilterFd filterFd){
        this.filterFds.add(filterFd);
    }
    public void addResultFd(ResultFd resultFd){
        this.resultFds.add(resultFd);
    }
    public List<String> getResultNames(String ndName){
        List<String> fdNames = new ArrayList<>();
        for( ResultFd resultFd : this.resultFds ) {
            if (ndName.equals(resultFd.getNdName()))
                fdNames.add(resultFd.getFdName());
        }
        return fdNames;
    }
}
